package com.xinjian.jianba.exception;

import java.util.Map;

/**
 * 返回状态码的异常对象.
 *
 *
 */
public class ResponseCodeAwareException extends RuntimeException {

	private static final long serialVersionUID = -9164920687246694473L;

	private Integer code;

	private String message;

	private Map<String, Object> config;

	/**
	 * 构造函数.
	 *
	 * @param code
	 *            状态码
	 * @param message
	 *            错误消息
	 */
	public ResponseCodeAwareException(Integer code, String message) {
		super(message);
		this.code = code;
		this.message = message;
	}

	public ResponseCodeAwareException(Integer code, String message, Map<String, Object> config) {
		super(message);
		this.code = code;
		this.message = message;
		this.config = config;
	}
	public ResponseCodeAwareException(Integer code,String message,Throwable cause){
		super(message,cause);
		this.code=code;
		this.message=message;
	}

	public Integer getCode() {
		return code;
	}

	@Override
	public String getMessage() {
		return message;
	}

	public Map<String, Object> getConfig() {
		return config;
	}

	public void setConfig(Map<String, Object> config) {
		this.config = config;
	}
}
